.PHONY:all
all::libdynamic.so libstatic.a

##动态库##
libdynamic.so:print_d.o accum_d.o
	gcc -shared print_d.o accum_d.o -o libdynamic.so

print_d.o:print.c
	gcc -fPIC -c print.c -o print_d.o
accum_d.o:accum.c
	gcc -fPIC -c accum.c -o accum_d.o
####


##静态库##
libstatic.a:print.o accum.o
	ar -rc libstatic.a accum.o print.o

print.o:print.c
	gcc -c print.c -o print.o
accum.o:accum.c
	gcc -c accum.c -o accum.o
####


.PHONY:output
output:
	mkdir -p output/lib 
	mkdir -p output/include
	cp -rf *.h output/include
	cp -rf *.a *.so output/lib 

.PHONY:clean
clean:
	rm -rf *.o *.a *.so output


